package com.taotie.thetoolofgluttony.common;

import com.taotie.thetoolofgluttony.TheToolOfGluttony;

import net.minecraftforge.common.config.Config;
import net.minecraftforge.common.config.ConfigManager;
import net.minecraftforge.fml.client.event.ConfigChangedEvent;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;

@Config(modid = TheToolOfGluttony.MODID)
@Config.LangKey("config.thetoolofgluttony")
public class ModConfig {
	@Config.Comment("Input your Secret Key")
	@Config.LangKey("config.thetoolofgluttony.secretkey")
	@Config.Name("Secret Key")
	public static String secretKey = "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX";

	@Mod.EventBusSubscriber(modid = TheToolOfGluttony.MODID)
	public static class ConfigSyncHandler {
		public static FMLPreInitializationEvent event1;

		@SubscribeEvent
		public static void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent event) {
			if (event.getModID().equals(TheToolOfGluttony.MODID)) {
				ConfigManager.sync(TheToolOfGluttony.MODID, Config.Type.INSTANCE);
				ConfigL.updata(event1);
			}
		}
	}
}